package com.atuguigu.boot3.core.service;

import com.atuguigu.boot3.core.event.LoginSuccessEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

@Service
public class AccountService implements ApplicationListener<LoginSuccessEvent> {
    public void addAccountScore(String username){
        System.out.println(username+"添加了1积分");
    }

    @Override
    public void onApplicationEvent(LoginSuccessEvent event) {
        System.out.println("账户接口收到监听信息");
        //User source = (User)event.getSource();
        //addAccountScore(source.getUsername());
    }
}
